<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
#parse("page_include.html")
</head>
<body>
	<div data-type="layout" data-defs="fit:true">
		<div data-defs="region:'north',border:true,split:true" style="height: 93px; padding: 2px"
			title="#springMessage('queryCondition')">
			<form id="queryForm" method="post">
				<table class="stable" cellpadding="1" cellspacing="1" style="width: 100%">
					<tr>
						<td width="15%" class="stdlabel">#springMessage("processName")</td>
						<td width="15%" class="stdinput">
							<input data-type="inputbox" type="text" name="processName" data-defs="required:false"></input>
						</td>
						<td colspan="4">&nbsp;</td>
					</tr>
					<tr>
						<td colspan="4"></td>
						<td colspan="2">
							<div style="margin: 0px 0; padding-top: 5px;" align="right">
								<a id="queryButton" href="javascript:void(0)" data-type="button" data-defs="iconCls:'icon-search'">查询</a>
								<a id="clearButton" href="javascript:void(0)" data-type="button" data-defs="iconCls:'icon-reload'">清空</a>
							</div>
						</td>
					</tr>
				</table>
			</form>
		</div>
		<div data-defs="region:'center',title:'#springMessage('processDiagramInfo')',border:true,split:true"
			style="padding: 0px;">
			<iframe id="processDiagramId" name="processDiagramId" src="${rc.contextPath}/assets/blank.html" width="100%"
				height="99.2%" style="overflow: auto;" frameborder="no" border="0" marginwidth="0" marginheight="0" scrolling="yes">
			</iframe>
		</div>
		<div data-defs="region:'west',split:true,title:'#springMessage('processDefInfo')',border:true,split:true"
			style="width: 200px; padding: 1px;">
			<table id="processdefinition_grid" data-type="grid" title="" style="height: 200px"
				data-defs="
				method:'post',url: '${rc.contextPath}/activiti/getProcessDefinations.do',idField:'processDefinitionId',
				rownumbers:true, pagination:false, toolbar: '#tb1',singleSelect:true,
				onCheck:getProcessDiagram,
				fitColumns:true, fit:true">
				<thead>
					<tr>
						<!-- 流程标志 -->
						<th data-defs="field:'processDefinitionId',width:80,checkbox:true">processDefinitionId</th>
						<!-- 流程标志 -->
						<th data-defs="field:'processKey',width:200,hidden:true">#springMessage("processKey")</th>
						<!-- 流程名称 -->
						<th data-defs="field:'processName',width:200">#springMessage("processName")</th>
					</tr>
				</thead>
			</table>
			<div id="tb1" style="height: auto">
				<a id="addButton" href="javascript:void(0)" data-type="button" data-defs="iconCls:'icon-add',plain:true">#springMessage("buttonEnableProcess")</a>
				<a id="editButton" href="javascript:void(0)" data-type="button"
					data-defs="iconCls:'icon-edit',plain:true">#springMessage("buttonDisableProcess")</a>
			</div>
		</div>
	</div>
	<script type="text/javascript">
		//根据选择的人员信息获得人员的角色和资源信息
        function getProcessDiagram(index, data) {
        	var pdid;
        	if(index==0){
        		pdid = data.processDefinitionId;
        	}else{
        		pdid = data[index].processDefinitionId;
        	}
            var url = '${rc.contextPath}/activiti/toProcessDiagramView.do?pdid='+pdid;
	        $("#processDiagramId").attr("src", url);
        }
        $(document).ready(function() {
	        $("#clearButton").bind("click", function() {
		        $("#queryForm").form('clear');
	        });
	        $("#queryButton").bind("click", function() {
		        var formValues = JSON.stringify($("#queryForm").form('getValues'));
		        $('#processdefinition_grid').grid('load', {
			        where : formValues
		        });
	        });
        });
	</script>
</body>
</html>